﻿using BIS.Utility.DAL.DataMapper;
using BIS.Utility.Converter;

namespace BIS.Portal.Modules.CMS.Entity
{
    public class ClientCmsArticleDetailsEntity : IEntity
    {

        #region Private member

        private int _article_id;
        private string _thumb_image;
        private string _article_title;
        private string _article_description;
        private string _page_alias;
        private int _category_id;
        private string _article_content;
        private string _category_name;

        #endregion

        #region Pulbic properties

        public int ArticleId
        {
            get { return _article_id; }
            set { _article_id = value; }
        }

        public string ThumbImage
        {
            get { return _thumb_image; }
            set { _thumb_image = value; }
        }

        public string ArticleTitle
        {
            get { return _article_title; }
            set { _article_title = value; }
        }

        public string ArticleDescription
        {
            get { return _article_description; }
            set { _article_description = value; }
        }

        public string PageAlias
        {
            get { return _page_alias; }
            set { _page_alias = value; }
        }

        public int CategoryId
        {
            get { return _category_id; }
            set { _category_id = value; }
        }

        public string ArticleContent
        {
            get { return _article_content; }
            set { _article_content = value; }
        }

        public string CategoryName
        {
            get { return _category_name; }
            set { _category_name = value; }
        }

        #endregion

        #region Implement From IEntity Member

        public void Fill(System.Data.IDataReader reader)
        {
            ArticleId = Functions.GetInt(reader["article_id"]);
            ThumbImage = Functions.GetString(reader["thumb_image"]);
            ArticleTitle = Functions.GetString(reader["article_title"]);
            ArticleDescription = Functions.GetString(reader["article_description"]);
            PageAlias = Functions.GetString(reader["page_alias"]);
            CategoryId = Functions.GetInt(reader["category_id"]);
            ArticleContent = Functions.GetString(reader["article_content"]);
            CategoryName = Functions.GetString(reader["category_name"]);
        }
        #endregion

    }
}
